//
//  AppManager.swift
//  DLuxTravel
//
//  Created by 陆涛 on 2018/11/22.
//  Copyright © 2018 imguider. All rights reserved.
//

import UIKit

class AppManager: NSObject {
    
    var keyWindow: UIWindow? {
        
        let appDelegate = UIApplication.shared.delegate as? AppDelegate
        
        return appDelegate?.window
    }
    
    /// 单例对象
    static let share = AppManager()
    
    func loginPage(_ jumpScan:Bool = false) {
        
        let loginVC = LoginVC()
        
        let nav = BaseNav(rootViewController: loginVC)
        
        guard let topVC = Util.topViewController() else {
            
            keyWindow?.rootViewController = nav
            return
        }
        
        topVC.present(nav, animated: true, completion: nil)
    }
    
    func HomePage() {
        
        let homeVC = HomeVC()
        
        let nav = BaseNav(rootViewController: homeVC)
        
        keyWindow?.rootViewController = nav
    }
}

